import request from '@/api/request.js'
// 角色列表
export const getRoleList = (params) => {
  return request({
    url: 'role/v_list.do',
    method: 'GET',
    params
  })
}

// 点击修改查询数据
export const getupdate = (params) => {
  return request({
    url: `role/show_detail?id=${params.id}`,
    method: 'POST',
    params
  })
}

// 修改角色
export const updateRole = (data) => {
  return request({
    url: 'role/o_update',
    method: 'POST',
    data
  })
}
// 添加角色
export const createRole = (data) => {
  return request({
    url: 'role/o_save',
    method: 'POST',
    data
  })
}
// 点击添加按钮查询角色列表
export const createRoleList = () => {
  return request({
    url: 'role/v_add',
    method: 'POST'
  })
}
// 删除角色
export const deleteRole = (data) => {
  return request({
    url: 'role/o_delete',
    method: 'POST',
    data
  })
}
// 点击成员管理
export const getmembersList = (params) => {
  return request({
    url: `role/v_list_members?roleId=${params.roleId}&pageNo=${params.pageNo}&pageSize=${params.pageSize}`,
    method: 'GET',
    params
  })
}

// 移除成员
export const deleteMember = (params) => {
  return request({
    url: `role/o_delete_member?roleId=${params.roleId}&userIds=${params.userIds}`,
    method: 'GET'
  })
}
